snapcraft.yaml validation errors are presented in a very user unfriendly way
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
When updating a snap to use core24, I ran into one of the syntax changes and received the following error message:
$ snapcraft
snapcraft internal error: ValidationError(model='SnapcraftBuildPlanner', errors=[{'loc': ('architectures', 0), 'msg': 'str type expected', 'type': 'type_error.str'}, {'loc': ('architectures', 0, 'run-on'), 'msg': 'extra fields not permitted', 'type': 'value_error.extra'}])
Full execution log: '/home/james/.local/state/snapcraft/log/snapcraft-20240517-140421.326386.log'
Checking the full execution log showed the following near the bottom:
2024-05-17 14:04:21.444 pydantic.error_wrappers.ValidationError: 2 validation errors for SnapcraftBuildPlanner
2024-05-17 14:04:21.444 architectures -> 0
2024-05-17 14:04:21.444 str type expected (type=type_error.str)
2024-05-17 14:04:21.444 architectures -> 0 -> run-on
2024-05-17 14:04:21.444 extra fields not permitted (type=value_error.extra)
It seems like a bug that the more user friendly presentation of the error would be saved for the log file, and the more obscure form printed to stderr.
Evaluation history
No evaluation history available.